﻿namespace KuiHuaBaoDian.Services.Animation {

    /// <summary>
    /// 动画触发
    /// </summary>
    public struct AnimationTrigger {

        /// <summary>
        /// 触发参数ID,一般由<see cref="UnityEngine.Animator.StringToHash(string)"/>生成
        /// </summary>
        public int ParameterID;

        public override readonly bool Equals(object obj) {
            if (obj is AnimationTrigger other) {
                return other.ParameterID == ParameterID;
            }
            return false;
        }

        public override readonly int GetHashCode() => ParameterID;

        public override readonly string ToString() => ParameterID.ToString();

        public static bool operator ==(AnimationTrigger left, AnimationTrigger right) => left.Equals(right);

        public static bool operator !=(AnimationTrigger left, AnimationTrigger right) => !left.Equals(right);
    }
}
